<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <style type="text/css">
        @import "${pageContext.request.contextPath}/assets/dojo/dojo/resources/dojo.css";
        @import "${pageContext.request.contextPath}/assets/dojo/dijit/themes/soria/soria.css";
        @import "${pageContext.request.contextPath}/assets/dojo/dijit/themes/claro/claro.css";
        @import "${pageContext.request.contextPath}/assets/dojo/dijit/themes/nihilo/nihilo.css";
		@import "${pageContext.request.contextPath}/assets/dojo/dojox/grid/resources/claroGrid.css";
		@import "${pageContext.request.contextPath}/assets/dojo/dojox/form/resources/CheckedMultiSelect.css";
		@import "${pageContext.request.contextPath}/assets/dojo/dojox/grid/enhanced/resources/EnhancedGrid_rtl.css";
		@import "${pageContext.request.contextPath}/assets/dojo/dojox/grid/enhanced/resources/claro/EnhancedGrid.css";
		@import "${pageContext.request.contextPath}/assets/dojo/dojox/layout/resources/ExpandoPane.css";
		@import "${pageContext.request.contextPath}/assets/style/module.css";
		@import "${pageContext.request.contextPath}/assets/style/kijit.css";
		@import "${pageContext.request.contextPath}/assets/style/icon_s_admin.css";
		@import "${pageContext.request.contextPath}/assets/style/icon_s_office.css";
		@import "${pageContext.request.contextPath}/assets/kanas/resources/commonIcons16.css";
    </style>
	<script src="${pageContext.request.contextPath}/assets/appscript/dojoconfigbaseurl.js" type="text/javascript"></script>
	<script src="${pageContext.request.contextPath}/assets/appscript/dojoconfig.js" type="text/javascript"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/assets/dojo/dojo/dojo.js" data-dojo-config="parseOnLoad: true,async:true,locale:'zh',isDebug: false"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/assets/kanas/kanas-base.js"></script>
</head>

<body class="claro loading" >
	<script type="text/javascript">
	//<![CDATA[
	    $ka.loading("load()");
		function load(){
			require(["dojo/ready","dojo/parser","dojo/i18n!appscript/locale/nls/Inspector","appscript/Module","dojo/on",
			        "dijit/tree/ObjectStoreModel", "dijit/Tree","dijit/TitlePane","dojox/layout/ExpandoPane","dijit/layout/AccordionContainer",
					"dojo/_base/kernel","dojo/_base/loader","dijit/Menu","dijit/MenuItem",
					"dijit/layout/BorderContainer","dijit/layout/ContentPane","dijit/layout/TabContainer","dojo/store/Memory",
	    			"dijit/Toolbar","dijit/Dialog","dijit/form/Form","dijit/ProgressBar","dijit/form/Select","dijit/Tree","dijit/InlineEditBox",
	    			"dijit/form/Button","dijit/form/RadioButton","dijit/form/CheckBox","dijit/form/ValidationTextBox","dojox/grid/TreeGrid",
	    			"dojox/data/QueryReadStore","dojox/layout/ContentPane","dojox/widget/DialogSimple","dijit/layout/SplitContainer",
	    			"dojo/data/ItemFileWriteStore","dijit/form/NumberTextBox","dojo/data/ItemFileReadStore","dojox/grid/DataGrid",
	    			"dojox/grid/EnhancedGrid","dojox/grid/enhanced/plugins/Menu","dojox/grid/enhanced/plugins/IndirectSelection","dojox/grid/enhanced/plugins/Filter",
	    			"dijit/layout/StackContainer","dijit/layout/StackController","dijit/form/DateTextBox"
					],
				function(ready,parser,i18n,module,on){
					if(typeof Inspector ==="undefined"){
						Inspector={
							_resource:i18n,
				    		init:function(){
				    			module.nodeLoaded(document.body);
				    			dijit.byId("ep_inspector_left").set("title",i18n.category);
								dijit.byId("btn_inspector_new").set("label",module.commonResource.create);
								dijit.byId("btn_inspector_edit").set("label",module.commonResource.edit);
								dijit.byId("btn_inspector_remove").set("label",module.commonResource.remove);
								dijit.byId("btn_inspector_refresh").set("label",module.commonResource.refresh);
								dijit.byId("btn_inspector_query").set("label",module.commonResource.query);
								dijit.byId("btn_inspector_recycle").set("label",module.commonResource.recycle);
								dijit.byId("btn_inspector_save").set("label",module.commonResource.save);
								dijit.byId("btn_inspector_update").set("label",module.commonResource.save);
								dijit.byId("btn_inspector_new_back").set("label",module.commonResource.goBack);
								dijit.byId("btn_inspector_edit_back").set("label",module.commonResource.goBack);
								dijit.byId("btn_inspector_new_cancel").set("label",module.commonResource.cancel);
								dijit.byId("btn_inspector_edit_cancel").set("label",module.commonResource.cancel);
				    	    },
				    	    getCategories:function(){
				    	    	var xhrArgs = {
				 	    			url: "../../inspector/categories",
			 	    			    handleAs: "text",
			 	    			    load: function(data){
			 	    			    	eval("data="+data);
			 	    			    	var catStore = new dojo.store.Memory({
			 								data:data,
			 								getChildren:function(object){
			 									return this.query({parent: object.id});
			 								}
			 							});	
			 	    			    	var catModel = new dijit.tree.ObjectStoreModel({
			 	    			           store: catStore,
			 	    			           query: {id: 'root'}
			 	    			       	});
			 	    			    	var catTree = new dijit.Tree({
			 	    			    		model : catModel,
			 	    			    		showRoot: true,
			 	    			    		openOnClick: false
			 	    			    	}, 'entityCategoryTree');
			 	    			    	catTree.startup();
			 	    			    	on(catTree, "click", function(item,node,evt){
			 	    			    		if(node.getChildren()==null || node.getChildren()==""){
			 	    			    			dijit.byId("pane_grid_container").set("href", "../../inspector/"+item.id+"/dataview");
			 	    			    		}
			 	    			    	});
		 	    			    	},
			 	    			    error: function(error){
				 	    				    	
			 	    			    }
				 	    		};
				 	    		dojo.xhrGet(xhrArgs);
				    	    }
					    };
						Inspector.getCategories();
			    	}
					ready(Inspector.init);
			});
		}
	//]]>
	</script>
	<div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'sidebar'" data-temp-attr="temp" style="display:none;width:100%;height:100%;background-color:none;">
		<div id="ep_inspector_left" data-dojo-type="dojox/layout/ExpandoPane" data-dojo-props="region:'leading'" style="width:200px;">
			<div data-dojo-type="dijit/layout/ContentPane" style="border:1px solid #769DC0;padding:0px;">
				<div id="entityCategoryTree"></div>
			</div>
		</div>
		<div id="sc_inspector_toolbar" data-dojo-type="dijit/layout/StackContainer" data-dojo-props="region:'top'" style="margin:0px;padding:0px;" >
			<div id="tb_inspector_view" data-dojo-type="dijit.Toolbar">
				<div id="btn_inspector_refresh" data-dojo-type="dijit.form.Button" data-dojo-props="iconClass:'icon_s_office  icon_s_office_file_refresh', showLabel:true" style="float:right;">
					<script type="dojo/on" data-dojo-event="click" data-dojo-args="evt">
						DataView.refresh();
					</script>
				</div>
				<div id="btn_inspector_query" data-dojo-type="dijit.form.Button" data-dojo-props="iconClass:'icon_s_office  icon_s_office_file_find', showLabel:true" style="float:right;"></div>
				<div id="btn_inspector_recycle" data-dojo-type="dijit.form.Button" data-dojo-props="iconClass:'icon_s_office  icon_s_office_file_find', showLabel:true" style="float:right;">
					<script type="dojo/on" data-dojo-event="click" data-dojo-args="evt">
						DataView.refresh(1);
					</script>
				</div>
				<div id="btn_inspector_new" data-dojo-type="dijit.form.Button" data-dojo-props="iconClass:'icon_s_office  icon_s_office_file_new', showLabel:true">
					<script type="dojo/on" data-dojo-event="click" data-dojo-args="evt">
						DataView.addNew();
					</script>
				</div>
				<div id="btn_inspector_edit" data-dojo-type="dijit.form.Button" data-dojo-props="iconClass:'icon_s_office  icon_s_office_file_edit', showLabel:true">
					<script type="dojo/on" data-dojo-event="click" data-dojo-args="evt">
						DataView.callEdit();
					</script>
				</div>
				<div id="btn_inspector_remove" data-dojo-type="dijit.form.Button" data-dojo-props="iconClass:'icon_s_office  icon_s_office_file_remove', showLabel:true">
					<script type="dojo/on" data-dojo-event="click" data-dojo-args="evt">
						DataView.callRemove();
					</script>
				</div>
			</div>
			<div id="tb_inspector_new" data-dojo-type="dijit.Toolbar">
				<div id="btn_inspector_new_cancel" data-dojo-type="dijit.form.Button" data-dojo-props="iconClass:'icon_s_office  icon_s_office_file_inactive', showLabel:true" style="float:right;">
					<script type="dojo/on" data-dojo-event="click" data-dojo-args="evt">
						DataView.closeCurrent();
					</script>
				</div>
				<div id="btn_inspector_save" data-dojo-type="dijit.form.Button" data-dojo-props="iconClass:'icon_s_office  icon_s_office_file_save', showLabel:true">
					<script type="dojo/on" data-dojo-event="click" data-dojo-args="evt">
						DataViewNew.addNew();
					</script>
				</div>
				<div id="btn_inspector_new_back" data-dojo-type="dijit.form.Button" data-dojo-props="iconClass:'icon_s_office  icon_s_office_file_go', showLabel:true">
					<script type="dojo/on" data-dojo-event="click" data-dojo-args="evt">
						DataView.back();
					</script>
				</div>
			</div>
			<div id="tb_inspector_edit" data-dojo-type="dijit.Toolbar">
				<div id="btn_inspector_edit_cancel" data-dojo-type="dijit.form.Button" data-dojo-props="iconClass:'icon_s_office  icon_s_office_file_inactive', showLabel:true" style="float:right;">
					<script type="dojo/on" data-dojo-event="click" data-dojo-args="evt">
						DataView.closeCurrent();
					</script>
				</div>
				<div id="btn_inspector_update" data-dojo-type="dijit.form.Button" data-dojo-props="iconClass:'icon_s_office  icon_s_office_file_save', showLabel:true">
					<script type="dojo/on" data-dojo-event="click" data-dojo-args="evt">
						DataViewNew.addNew();
					</script>
				</div>
				<div id="btn_inspector_edit_back" data-dojo-type="dijit.form.Button" data-dojo-props="iconClass:'icon_s_office  icon_s_office_file_go', showLabel:true">
					<script type="dojo/on" data-dojo-event="click" data-dojo-args="evt">
						DataView.back();
					</script>
				</div>
			</div>
		</div>
		<div id="pane_grid_container" data-dojo-type="dojox/layout/ContentPane" data-dojo-props="region:'center'" style="margin:0px;padding:0px;border:none;" >
		</div>
	</div>
</body>
</html>